package com.dkt.wap.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;

import com.dkt.base.domain.User;
import com.dkt.wap.domain.UserMapper;
import com.dkt.wap.web.dto.UserDto;

@Service
public class UserSrvImpl implements UserSrv {

	@Autowired
	private UserMapper userMapper;
	
	@Autowired
	private PasswordEncoder passwordEncoder;

	@Override
	public User loadUserByUsername(String username) throws UsernameNotFoundException {
		User user = userMapper.selUserByUsername(username);
		if (user == null) {
			throw new UsernameNotFoundException("username cannot be found!");
		}
		return user;
	}

	@Override
	public void userReg(UserDto userDto) {
		
	}

}
